using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XFFSM;
using XFGameFramework;

public class Fight_Player : FSMState
{
    #region 字段
    private Module module;
    public PlayerModel player;
    public EnemyModel enemy;
    private FightUIController fightUIController => module.LoadController<FightUIController>();
    private GameController gameController => module.LoadController<GameController>();
    private PlayerController playerController => module.LoadController<PlayerController>();
    private EnemyController enemyController => module.LoadController<EnemyController>();
    SkillController skillController => module.LoadController<SkillController>();

    #endregion

    public override void OnEnter()
    {
        base.OnEnter();

        module = userData as Module;
        if (module == null) throw new System.Exception("userData is not Module");

        //获取玩家和敌人数据
        enemy = module.GetModel<EnemyModel>();
        player = playerController.GetPlayerModel();
        Debug.Log("Enter Fight_Player");
        
    }


    public override void OnExit()
    {
       
        base.OnExit();
        FightInfo.Instance.Rounds++;//回合数增加
        fightUIController.UpdateAllText(player, enemy);

        Debug.Log("Exit Fight_Player");
    }
}
